import api from '@/api/index'
import { debtServer } from '@/utils/apiConfig'
// 分页查询信息
export const getTableList = <T>(data?: unknown) => {
  return api.get<T>(debtServer + '/reports/definition', data)
}
// 新增
export const addSubmit = <T>(data?: unknown) => {
  return api.post<T>(debtServer + '/reports/definition', data)
}
// 编辑
export const editSubmit = <T>(id: string, data?: unknown) => {
  return api.put<T>(debtServer + '/reports/definition/' + id, data)
}
// 获取详情
export const getDetailById = <T>(id: string) => {
  return api.get<T>(debtServer + '/reports/definition/' + id)
}
// 删除
export const deleteTable = <T>(id: string, data?: unknown) => {
  return api.delete<T>(debtServer + '/reports/definition/' + id, data)
}
// 查询报表关键字
export const getDataKeyList = <T>(data?: unknown) => {
  return api.get<T>(debtServer + '/reports/reportDataKeys', data)
}
// 查询报表
export const getTableDataDetail = <T>(id: string) => {
  return api.get<T>(debtServer + '/reports/' + id)
}
